<!DOCTYPE html>
<html lang="en">
  <head>
    <title>LayerAnimator Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Class/LayerAnimator" class="dashAnchor"></a>

    <a title="LayerAnimator Class Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          Wave
        </a>
         (100% documented)
      </p>
    
      <div class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </div>
    
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html"> Reference</a>
      <img class="carat" src="../img/carat.png" alt=""/>
      LayerAnimator Class Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/LayerAnimator.html">LayerAnimator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Spring.html">Spring</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/SpringAnimator.html">SpringAnimator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/SpringAnimator/Event.html">– Event</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ViewAnimator.html">ViewAnimator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Wave.html">Wave</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/AnimationMode.html">AnimationMode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/AnimatorState.html">AnimatorState</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/CALayer.html">CALayer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/CGFloat.html">CGFloat</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/CGPoint.html">CGPoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/CGRect.html">CGRect</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/CGSize.html">CGSize</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions.html#/s:4Wave14RGBAComponentsV">RGBAComponents</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UIView.html">UIView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/WaveColor.html">WaveColor</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave4clip5value5lower5upperxx_xxtSFRzlF">clip(value:lower:upper:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave8clipUnit5valuexx_tSFRzlF">clipUnit(value:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave8mapRange_____4clipxx_xxxxSbtSFRzlF">mapRange(_:_:_:_:_:clip:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave8mapRange5value5inMin0E3Max03outF00hG04clipxx_xxxxSbtSFRzlF">mapRange(value:inMin:inMax:outMin:outMax:clip:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave7project5point8velocity16decelerationRateSo7CGPointVAG_AG12CoreGraphics7CGFloatVtF">project(point:velocity:decelerationRate:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave7project5value8velocity16decelerationRate12CoreGraphics7CGFloatVAH_A2HtF">project(value:velocity:decelerationRate:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:4Wave10rubberband5value5range8interval1c12CoreGraphics7CGFloatVAI_SNyAIGA2ItF">rubberband(value:range:interval:c:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/SpringInterpolatable.html">SpringInterpolatable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/VelocityProviding.html">VelocityProviding</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/WaveColor">WaveColor</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:4Wave0A5Colora">WaveColor</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>LayerAnimator</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">LayerAnimator</span></code></pre>

                </div>
              </div>
            <p>The <code>LayerAnimator</code> class contains the supported <code>CALayer</code> animatable properties, like <code>cornerRadius</code>, <code>shadowColor</code>, <code>shadowOpacity</code>, and more.</p>

<p>In an Wave animation block, change these values to create an animation, like so:</p>

<p>Example usage:</p>
<pre class="highlight swift"><code><span class="kt">Wave</span><span class="o">.</span><span class="nf">animateWith</span><span class="p">(</span><span class="nv">spring</span><span class="p">:</span> <span class="o">.</span><span class="n">defaultAnimated</span><span class="p">)</span> <span class="p">{</span>
   <span class="n">myView</span><span class="o">.</span><span class="n">layer</span><span class="o">.</span><span class="n">animator</span><span class="o">.</span><span class="n">cornerRadius</span> <span class="o">=</span> <span class="mi">12</span>
   <span class="n">myView</span><span class="o">.</span><span class="n">layer</span><span class="o">.</span><span class="n">animator</span><span class="o">.</span><span class="n">shadowOpacity</span> <span class="o">=</span> <span class="mf">0.5</span>
<span class="p">}</span>
</code></pre>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Public"></a>
                <a name="//apple_ref/swift/Section/Public" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Public"></a>
                  <h3 class="section-name"><span>Public</span>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC12cornerRadius12CoreGraphics7CGFloatVvp"></a>
                    <a name="//apple_ref/swift/Property/cornerRadius" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC12cornerRadius12CoreGraphics7CGFloatVvp">cornerRadius</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The corner radius of the attached <code>layer</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">cornerRadius</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC7opacity12CoreGraphics7CGFloatVvp"></a>
                    <a name="//apple_ref/swift/Property/opacity" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC7opacity12CoreGraphics7CGFloatVvp">opacity</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The opacity of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">opacity</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC15backgroundColorSo10CGColorRefavp"></a>
                    <a name="//apple_ref/swift/Property/backgroundColor" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC15backgroundColorSo10CGColorRefavp">backgroundColor</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The background color of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">backgroundColor</span><span class="p">:</span> <span class="kt">CGColor</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC11borderColorSo10CGColorRefavp"></a>
                    <a name="//apple_ref/swift/Property/borderColor" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC11borderColorSo10CGColorRefavp">borderColor</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The border color of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">borderColor</span><span class="p">:</span> <span class="kt">CGColor</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC11borderWidth12CoreGraphics7CGFloatVvp"></a>
                    <a name="//apple_ref/swift/Property/borderWidth" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC11borderWidth12CoreGraphics7CGFloatVvp">borderWidth</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The border width of the attached <code>layer</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">borderWidth</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC13shadowOpacity12CoreGraphics7CGFloatVvp"></a>
                    <a name="//apple_ref/swift/Property/shadowOpacity" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC13shadowOpacity12CoreGraphics7CGFloatVvp">shadowOpacity</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The shadow opacity of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shadowOpacity</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC11shadowColorSo10CGColorRefavp"></a>
                    <a name="//apple_ref/swift/Property/shadowColor" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC11shadowColorSo10CGColorRefavp">shadowColor</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The shadow color of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shadowColor</span><span class="p">:</span> <span class="kt">CGColor</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC12shadowOffsetSo6CGSizeVvp"></a>
                    <a name="//apple_ref/swift/Property/shadowOffset" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC12shadowOffsetSo6CGSizeVvp">shadowOffset</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The shadow offset of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shadowOffset</span><span class="p">:</span> <span class="kt">CGSize</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:4Wave13LayerAnimatorC12shadowRadius12CoreGraphics7CGFloatVvp"></a>
                    <a name="//apple_ref/swift/Property/shadowRadius" class="dashAnchor"></a>
                    <a class="token" href="#/s:4Wave13LayerAnimatorC12shadowRadius12CoreGraphics7CGFloatVvp">shadowRadius</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The shadow radius of the attached layer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shadowRadius</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2022 <a class="link" href="https://github.com/jtrivedi" target="_blank" rel="external noopener">Janum Trivedi</a>. All rights reserved. (Last updated: 2022-11-14)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
    </section>
  </body>
</html>
